package service;

import dao.Dao;
import dao.DaoImpl;
import domain.Product;

import java.util.List;

/**
 * Created by guo on 2017/10/31.
 */
public class ServiceImpl implements Service {
    Dao dao=new DaoImpl();
    @Override
    public List<Product> findAll() {
        return dao.findAll();
    }

    @Override
    public int delete(int pid) {
        return dao.delete(pid);
    }

    @Override
    public List<Product> search(String pname) {
        return dao.search(pname);
    }

    @Override
    public int add(Product product) {
        return dao.add(product);
    }

    @Override
    public Product findById(int pid) {
        return dao.findById(pid);
    }

    @Override
    public int update(Product product) {
        return dao.update(product);
    }
}
